<!doctype html>
<html lang="zh-CH">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	{{--<meta name="viewport" content="width=device-width, initial-scale=1">--}}
	<title>木投网--商城--详情</title>
	<link rel="stylesheet" href="/resource/css/mt_index.css">
	<link rel="stylesheet" href="/resource/css/mt_now.css">
	<link rel="stylesheet" href="/resource/css/mt_showBo.css">
</head>
<body>
@include('common.shop_head')
<!-- 现货资源 -->
@foreach($data as $data1)
<div class="now-resource main">
	<div class="now-left left">
		<div class="title">当前位置：
			<a href="/">首页</a>&#62<a href="/shopping">商城</a>&#62
			<a href="/shopping_details?product_id={{$data1->product_id}}">{{$data1->product_name}}</a>
		</div>
		<div class="res-info">
			<div class="info-img left">
				<div class="img-booth">
					<img src="{{$data1->product_img}}" alt="">
				</div>
				<ul class="img-thumb">
                    @if(!empty($data1->show_img1))
                        <li class="active"><img src="{{$data1->show_img1}}" alt=""></li>
                    @else
                        <li class="active"><img src="/resource/img/floor_shop_none.png" alt=""></li>
                    @endif
                    @if(!empty($data1->show_img2))
                        <li><img src="{{$data1->show_img2}}" alt=""></li>
                    @endif
                    @if(!empty($data1->show_img3))
                        <li><img src="{{$data1->show_img3}}" alt=""></li>
                    @endif
				</ul>
				<ul class="info-arrow">
					<li class="pre"></li>
					<li class="next"></li>
				</ul>
				<span>{{$data1->product_sn}}</span>
			</div>
			<div class="info-font left">
				<h2 class="til">{{$data1->product_name}}</h2>
				<div class="price">价格：<span>￥<i>{{$data1->price}}</i>/{{$data1->unit}}</span></div>
				<ul class="font-details">
					<li>规 &#160; 格：<span>{{$data1->spec}}</span></li>
					<li>产 &#160; 地：<span>{{$data1->place}}</span></li>
					<li>等 &#160; 级：<span>@if($data1->level == "")-@else{{$data1->level}}@endif</span></li>
					<li>起订量：<span>{{$data1->start_num}}{{$data1->unit}}</span></li>
					<li>库存量：<span class="stock-num">{{$data1->stock}}{{$data1->unit}}</span></li>
					<li>仓储地：<span>{{$data1->storage}}</span></li>
				</ul>
					<input type="hidden" value="{{$data1->product_id}}" id="product_id">
				<ul class="contact-info">           
					<li>
						<div class="left"><span>采购数量：</span></div>
						<div class="info-num left">
							<a href="javascript:;" class="pre"></a>
							<input type="text" id="info-num" value="1" class="number">
							<a href="javascript:;" class="next"></a>
						</div>
					</li>
				</ul>
				<div class="info-shopping">
					@if(empty(session_get(UserEnum::USER_INFO_USER_ID)))
						<div class="a">
							<i></i><input type="button" value="加入购物车">
						</div>
						<div class="a">
							<a href="/shop_cart_list">查看购物车</a>
						</div>
						<script src="/resource/js/jquery-1.11.3.min.js"></script>
						<script>
							//登录
							$('.info-shopping .a').click(function(){
								loginShow();
							});
							function loginShow(){
								$('.popup-login').show();
								$('.popup').show();
							}
						</script>
					@else
						<div class="a">
							<i></i><input type="button" value="加入购物车">
						</div>
						<div class="a">
							<a href="/shop_cart_list">查看购物车</a>
						</div>
					@endif
				</div>
			</div>
		</div>
		<div class="res-illustrate">
			<div class="til">
				<span>商品说明</span>
			</div>
			<div class="ill-p">
				@if( $data1->description == "")
					-
				@else
				{{$data1->description}}
					@endif
			</div>
		</div>
	</div>
	<div class="now-right left">
		<div class="classify-right">
			<div class="til">推广商品</div>
			<div class="emphases-box">
				@foreach($ad_product as $v)
					<div class="floor-shop">
						<div class="shop-img">
							<a href="/shopping_details/?product_id={{$v->product_id}}"><img src="{{$v->product_img}}" alt=""></a>
						</div>
						<div class="shop-info">
							<a href="/shopping_details/?product_id={{$v->product_id}}" class="name"><span>{{$v->product_name}}</span></a>
							<div class="price">￥{{$v->price}}/{{$v->unit}}</div>
						</div>
					</div>
				@endforeach
			</div>
		</div>
	</div>
</div>
@endforeach
@include('common.shop_foot')
<script src="/resource/js/jquery-1.11.3.min.js"></script>
<script src="/resource/js/mt_index.js"></script>
<script src="/resource/js/mt_showBo.js"></script>  <!-- 提示信息 -->
<script>
	//导航 商品全部 隐藏显示
	var $allW = $('.all-wrap');
	$allW.hide();
	$('.nav .nav-all').attr('rel','hide');
	$('.nav .nav-all').click(function(){
		if($(this).attr('rel') == 'hide'){
			$(this).attr('rel','show');
			$allW.show();
		}else{
			$(this).attr('rel','hide');
			$allW.hide();
		};		
	})

	//点击提示成功加入购物车
	$('.info-shopping .a input').click(function(){
		var product_id = $("#product_id").val();
		var number = $(".number").val();
		$.ajax({
			url: "/shop_add_cart",
			type: 'post',
			data: "product_id="+product_id+"&number="+number,
			success: function (msg) {
				console.log(msg)
				if(msg){
					Showbo.Msg.amend('<img class="left" src="/resource/img/reg_success.png" alt=""><span style="float:left;line-height:72px;">加入购物车成功!</span>',function(btn){
						if (btn == 'yes') {
							window.location.href = '/shop_cart_list';
						}else{
							return false;
						};
					},'查看购物车');
					$('#dvMsgBox input.btn').css('width','100px');
					$('#dvMsgClose').css({
						'display':'block',
						'left': '450px',
						'top': '14px',
						'width': '25px',
						'height': '25px',
						'background': 'url(/resource/img/index_pic.png) no-repeat -163px -376px',
						'border':'none'
					});
				}
			}
		})

	});
</script>
</body>
</html>